class Setting
  include Mongoid::Document

  field :country, type: String
  field :language, type: String
  field :timezone, type: String

  embedded_in :user

  validates_presence_of :country, :language, :timezone

  def self.default_country
    "br"
  end

  def self.default_language
    "pt-BR"
  end

  def self.default_timezone
    "Brasilia"
  end

  def self.valid_languages
    ::I18n.available_locales
  end

  def self.options_languages
    self.valid_languages.collect{|language| [language, language]}
  end
end